from __future__ import print_function
import cv2
import logging
from imutils.video import WebcamVideoStream
from imutils.video import FPS
import argparse
import imutils
import cv2

logger = logging.getLogger('CameraBK')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('[%(asctime)s] [%(name)s] [%(levelname)s] %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)

if __name__ == '__main__':
    vs = WebcamVideoStream(src=0).start()
    while True:
        frame = vs.read()
        frame = imutils.resize(frame, width=640)
        cv2.imshow("CameraBK", frame)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    vs.stop()
    cv2.destroyAllWindows()
